package com.czc.leavext.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.czc.leavext.entity.Employee;
import com.czc.leavext.service.IEmployeeService;

@Controller
@RequestMapping("")
public class EmployeeController {
	@Autowired
	private IEmployeeService empService;
	
	@RequestMapping("/userController")
	public String index(HttpServletRequest request,HttpServletResponse response){
		HttpSession session = request.getSession();
		int id=1;
		Employee emp = empService.getEmployee(id);
		session.setAttribute("emp", emp);
		return "user";
	}
}
